package com.hrt.datasender.mq;

import com.hrt.datasender.datacollect.drive.modbus.tcp.NetBaseDrive;
import com.hrt.datasender.datadao.model.BcDevicesModel;
import com.hrt.datasender.datadao.model.BcSerialModel;
import com.hrt.datasender.mq.model.NetExportDataModel;
import com.hrt.datasender.mq.model.OpcModel;
import com.hrt.datasender.mq.model.SerialModel;

public class MqManager {

    /**
     * 获取询问串口数据消息，的队列名称
     * 
     * @param serialModel
     * @return
     */
    public static String getSerialAskDataQueueName(BcSerialModel serialModel) {
        String queueName = "SERIAL_" + serialModel.getComNum() + "_ASK";
        return queueName;
    }

    /**
     * 获取询问串口数据消息，的队列名称
     * 
     * @param serialModel
     * @return
     */
    public static String getSerialAskDataQueueName(SerialModel serialModel) {
        String queueName = "SERIAL_" + serialModel.getComNum() + "_ASK";
        return queueName;
    }

    /**
     * 获取串口数据消息，的队列名称
     * 
     * @param deviceModel
     * @return
     */
    public static String getSerialDataQueueName(BcDevicesModel deviceModel) {
        String queueName = "SERIAL_" + deviceModel.getComNum() + "_" + deviceModel.getDeviceNum();
        return queueName;
    }

    /**
     * 获取串口数据消息，的队列名称
     * 
     * @return
     */
    public static String getSerialDataQueueName(SerialModel serialModel) {
        String queueName = "SERIAL_" + serialModel.getComNum() + "_" + serialModel.getDeviceNum();
        return queueName;
    }

    /**
     * 获取网口数据消息，的队列名称
     * 
     * @return
     */
    public static String getNetExportDataQueueName(NetExportDataModel netExportModel) {
        String queueName = "NETExport_" + netExportModel.getIp() + "_" + netExportModel.getPort() + "_"
                + netExportModel.getDeviceInstanceId();
        return queueName;
    }

    /**
     * 获取网口数据消息，的队列名称
     * 
     * @return
     */
    public static String getNetExportDataQueueName(NetBaseDrive deive) {
        String queueName = "NETExport_" + deive.getIp() + "_" + deive.getPort() + "_" + deive.getDriveInstanceId();
        return queueName;
    }

    /**
     * 获取Opc数据消息，的队列名称
     * 
     * @param deviceModel
     * @return
     */
    public static String getOpcDataQueueName(BcDevicesModel deviceModel) {
        String queueName = "Opc_" + deviceModel.getDeviceName();
        return queueName;
    }

    /**
     * 获取Opc数据消息，的队列名称
     * 
     * @return
     */
    public static String getOpcDataQueueName(OpcModel opcModel) {
        String queueName = "Opc_" + opcModel.getDeviceName();
        return queueName;
    }

}
